package com.example.teamtribe.main.mine.setting;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.teamtribe.R;
import com.example.teamtribe.base.BaseActivity;
import com.example.teamtribe.hello.CoverActivity;
import com.example.teamtribe.main.mine.setting.certify.CertifyActivity;
import com.example.teamtribe.main.mine.setting.email.EmailActivity;

public class SettingActivity extends BaseActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mine_setting);

        ((TextView) findViewById(R.id.tv_title)).setText("设置");
        findViewById(R.id.tv_certify_email).setOnClickListener(this);
        findViewById(R.id.tv_certify_csust).setOnClickListener(this);
        findViewById(R.id.tv_restart).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_certify_email:
                startActivity(new Intent(SettingActivity.this, EmailActivity.class));
                break;

            case R.id.tv_certify_csust:
                startActivity(new Intent(SettingActivity.this, CertifyActivity.class));
                break;

            case R.id.tv_restart:
                new SettingPresenter().logout();
                Intent intent = new Intent(SettingActivity.this, CoverActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                startActivity(intent);

            default:
                break;
        }
    }
}
